import { ChartData } from '../Model/ChartData';
import ChartLineData from '../Model/ChartLineData';
const typeOrder = ['lowPressure', 'highPressure'];
export function handleChartData(g7, h7) {
    g7.verticalDataList = g7.verticalDataList.sort((r7, s7) => {
        const t7 = typeof r7.lineName === 'string' ? r7.lineName : '';
        const u7 = typeof s7.lineName === 'string' ? s7.lineName : '';
        const v7 = typeOrder.indexOf(t7);
        const w7 = typeOrder.indexOf(u7);
        return v7 - w7;
    });
    const i7 = new ChartData();
    const j7 = g7.horizontalDataList;
    const k7 = g7.horizontalAliasList;
    const l7 = g7.horizontalLabelList;
    const m7 = [];
    g7.verticalDataList.map((p7, q7) => {
        m7.push(new ChartLineData(p7.lineName || '', q7 == 0 ? "#F9365B" : '#02C4B3', p7.values || []));
    });
    i7.setXAis(j7);
    i7.setXAlias(k7);
    i7.setXLabel(l7);
    i7.setYAis(m7);
    i7.setTimeStep(h7 == 0 ? 6 : 1);
    return i7;
}
export function getSelectIndexBySelectData(d7, e7) {
    if (d7 == 0) {
        const f7 = e7.getHours() * 60 + e7.getMinutes();
        return f7;
    }
    else {
        return e7.getDay() == 0 ? 6 : e7.getDay() - 1;
    }
}
